/*
 * Copyright (c) 2020, 2023, 3044483124@qq.com All rights reserved.
 *
 */
package itcast;
import java.awt.*;
/**
 * <p>Project: JavaStudy - Opt5
 * <p>Powered by jiangbo On 2023-01-31
 * 16:34:42
 * <p>Created by IntelliJ IDEA
 *
 * @author jiangbo [3044483124@qq.com]
 * @version 1.0
 * @since 8/17
 */
public class Opt5 {
    public static void main(String[] args) {
//十六进制 0 - 9 - a - f
//直接输出十六进制，以十进制输出
        System.out.println();
        System.out.println(0xff);
        int n = 11;

        System.out.println("*".repeat(35));
//0a
        System.out.printf("%02x%n",n);
//ff
        System.out.printf("%02x%n",255);
//ff 10进制转换16进制输出字符
        System.out.println(Integer.toHexString(255));
        System.out.println(Integer.toHexString(16));
//16进制转换为10进制
        System.out.println(Integer.valueOf("e",16));

        Color c = new Color(0xff, 0x00, 0x00, 0xff);

//十进制 0-9
        int i = 6;
        System.out.println(i);
//八进制 0-7
//二进制 1 和 0
//12 2进制转10
        System.out.println(Integer.valueOf("1100",2));
//12 8进制转10
        System.out.println(Integer.valueOf("14",8));
        System.out.println(12&5);//4
        System.out.println(Integer.toBinaryString(12)); //1100
        System.out.println(Integer.toBinaryString(5));// 0101 0100
//参数是2进制输出是10进制 0b
        System.out.println(0b100);//4
        System.out.println(0xff);//255
//2进制
        System.out.println(0b1100);
//16进制 0x
        System.out.println(0x0c);
        System.out.println(0xc);
//8进制 0开头
        System.out.println(070); //56
        System.out.println(Integer.valueOf("70",8)); //56
//12 014是8进制代表10进制的12
        System.out.println(014);
//二进制 1 1 2 10*/
    }
}


